<!DOCtype html>
<html ng-app="advertiserApp">
	 <head>
	     <meta charset= "utf-8"/>
		 <title>已投放广告</title>
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/static/vendor/angular/angular.min.js"></script>
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/static/vendor/jquery/dist/jquery.min.js"></script>		 		 
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/static/vendor/bootstrap/dist/js/bootstrap.min.js"></script>			
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/static/js/mainApp.js"></script>			 			 
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/controller/adManagement/alreadyAdCtrl/queryAd.js"></script>
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/static/js/main.js"></script>
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/controller/adManagement/alreadyAdCtrl/index.js"></script>				        				 			 
		 <link rel="stylesheet" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/vendor/bootstrap/dist/css/bootstrap.min.css" />
		 <link rel="stylesheet" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
		 <link rel="stylesheet" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/styles/layout.css" />
		 <link rel="stylesheet" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/styles/main.css" />
		 <link rel="stylesheet" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/styles/table.css" />
		 <link rel="shortcut icon" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/favicon.ico" />
		 <link rel="bookmark" href="/Lvscore_Advertiser_Maven/advertiserWeb/static/favicon.ico" />		
		 <style>
		 	.table>tbody>tr>td,.table>tbody>tr>th{padding:8px 0;}
		 	.content table tr .redtd{color:red}
		 </style>
	 </head>
	 <body ng-controller="advertiserCtrl" >		   	        
        <div class="headerBox"></div>
         <div class="nav"><ul></ul></div>
		 <div class="content">    		 
		     <div class="websiteMapBox">
			     <span>当前页面></span>
				 <span id ="finishedAd">已投放广告</span>
			 </div>
			 <table id="finishedAdtable" class="table table-striped table-bordered table-hover">    
			     <tr>
			     	<th>序号</th>
			     	<th>广告名称</th>
			     	<th>广告编号</th>
			     	<th>投放开始时间</th>
			     	<th>投放截止时间</th>
			     	<th>广告形式</th>
			     	<th>投放终端</th>
			     	<th>投放支出金额(元)</th>
					<th>投放余额(元)</th>
			     	<th>广告状态</th>
					<th>投放状态</th>
			     	<th>操作</th>
			     </tr>
			     <tr ng-repeat="item in tableData"> 
			     	<td ng-bind="$index+1"></td>
			     	<td ng-bind="item.adName"></td>
			     	<td ng-bind="item.advertiserCode"></td>
			     	<td ng-bind="translate(item.startTime)|date:'yyyy.MM.dd'"></td>
			     	<td ng-if="endNTime(item.endTime)|date:'yyyy.MM.dd'" ng-bind="translate(item.endTime)|date:'yyyy.MM.dd'"></td>  
			     	<td class="redtd" ng-if="endTime(item.endTime)|date:'yyyy.MM.dd'" ng-bind="translate(item.endTime)|date:'yyyy.MM.dd'"></td>
			     	<td ng-bind="item.adType|filterAdType"></td>
			     	<td ng-bind="item.terminalinfo|filterTerminalType"></td>
			     	<td ng-bind="item.consumeAmount|number:2"></td>
			     	<td ng-if="!adBalance(item.status)" ng-bind="item.advertiserBalance|number:2"></td>
			     	<td ng-if="adBalance(item.status)" ng-bind="item.advertiserBalance|number:2" style="color:red"></td>
			     	<td ng-if="adNBalance(item.status,item.endTime)">系统下架(时间、余额)</td>
			     	<td ng-if="!adNBalance(item.status,item.endTime)" ng-bind="item.status"></td>
			     	<td ng-bind="item.adStatus"></td>
					<td>
						 <button ng-click="stop(item.adId)" ng-if="editStatus(item.status)&&lineStatus(item.adStatus)" class="btn btn-primary">暂停</button>
						 <button ng-click="stop(item.adId)" ng-if="editStatus(item.status)&&lnStatus(item.adStatus) class="btn btn-primary" disabled="disabled">暂停</button>
						 <button ng-click="putIn(item.id,item.adType,item.adId,item.status)" ng-if="editStop(item.status)&&lineStatus(item.adStatus)&&endNTime(item.endTime)|date:'yyyy.MM.dd'" class="btn btn-primary">投放</button>
						 <button ng-click="putIn(item.id,item.adType,item.adId,item.status)" ng-if="editStop(item.status)&&lineStatus(item.adStatus)&&endTime(item.endTime)|date:'yyyy.MM.dd'" class="btn btn-primary" disabled="disabled">投放</button>
						 <button ng-click="putIn(item.id,item.channelPrice)" ng-if="editStop(item.status)&&lnStatus(item.adStatus)" class="btn btn-primary" disabled="disabled">投放</button>
						 <button ng-click="deletePlacementAd(item.id,item.advertiserBalance)" ng-if="!editSystem(item.status)&&editStatus(item.status)"class="btn btn-primary" disabled="disabled">删除</button>
					     <button ng-click="deletePlacementAd(item.id,item.advertiserBalance,item.adId,item.deliveryRemainingAmount)" ng-if="!editSystem(item.status)&&!editStatus(item.status)"class="btn btn-primary">删除</button>
					     <a ng-href="/Lvscore_Advertiser_Maven/advertiserWeb/views/adManagement/pictureAd/editPictureAd.html?selectedNav=2&navPos=0&adId={{item.adId}}" ng-if="!editSystem(item.status)&&!details(item.adType)&&lineStatus(item.adStatus)" class="btn btn-primary">编辑</a>
					     <button ng-if="!editSystem(item.status)&&!details(item.adType)&&lnStatus(item.adStatus)" class="btn btn-primary" disabled="disabled">编辑</button>
					     <a ng-href="/Lvscore_Advertiser_Maven/advertiserWeb/views/adManagement/vedioAd/editVedioAd.html?selectedNav=2&navPos=0&adId={{item.adId}}" ng-if="!editSystem(item.status)&&details(item.adType)&&lineStatus(item.adStatus)" class="btn btn-primary">编辑</a>
					     <button ng-if="!editSystem(item.status)&&details(item.adType)&&lnStatus(item.adStatus)" class="btn btn-primary" disabled="disabled">编辑</button>
					     <a ng-href="/Lvscore_Advertiser_Maven/advertiserWeb/views/adManagement/pictureAd/queryPictureAd.html?selectedNav=2&navPos=0&adId={{item.adId}}" ng-if="!editSystem(item.status)&&!details(item.adType)" class="btn btn-primary">查看</a>
					     <a ng-href="/Lvscore_Advertiser_Maven/advertiserWeb/views/adManagement/vedioAd/queryVedioAd.html?selectedNav=2&navPos=0&adId={{item.adId}}" ng-if="!editSystem(item.status)&&details(item.adType)" class="btn btn-primary">查看</a>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&details(item.adType)&&padVersion(item.terminalType)" data-target=".videoModal" ng-click="flashVideo(item.padVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&details(item.adType)&&pcVersion(item.terminalType)" data-target=".videoModal" ng-click="flashVideo(item.pcVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&details(item.adType)&&mobileVersion(item.terminalType)" data-target=".videoModal" ng-click="flashVideo(item.mobileVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&details(item.adType)&&tvVersion(item.terminalType)" data-target=".videoModal" ng-click="flashVideo(item.tvVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&!details(item.adType)&&padVersion(item.terminalType)" data-target=".imageModal" ng-click="flashImg(item.padVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&!details(item.adType)&&pcVersion(item.terminalType)" data-target=".imageModal" ng-click="flashImg(item.pcVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&!details(item.adType)&&mobileVersion(item.terminalType)" data-target=".imageModal" ng-click="flashImg(item.mobileVersionUrl,item.adHomepage)">预览</button>
				         <button class="btn btn-primary" data-toggle="modal" ng-if="!editSystem(item.status)&&!details(item.adType)&&tvVersion(item.terminalType)" data-target=".imageModal" ng-click="flashImg(item.tvVersionUrl,item.adHomepage)">预览</button>
					</td>			    
				 </tr>				 
			 </table>
		 </div>	
		 <!-- video modal -->
         <div class="modal fade videoModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
             <div class="modal-dialog modal-lg">
                 <div class="modal-content"  style="position:relative"> 
				     <div id="flashVideoBox" style="height:560px;"></div>
					 <div onclick="flashImg.closeVideo($(this))" data-dismiss="modal" style="font-size:18px;position:absolute;top:4px;right:8px;color:#0787FF;cursor:pointer;">X</div>				
                 </div>
             </div>
         </div>	
         <!-- image modal -->
		 <div class="modal fade imageModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
             <div class="modal-dialog modal-lg" style="width:1200px;">		     
                 <div class="modal-content" style="position:relative"> 
                     <div data-dismiss="modal" style="position:absolute;top:10px;right:10px;cursor:pointer;font-size:18px;">X</div>
					 <div class="flashImgHomePage">
					     <div class="topTitle">
				             <button class="btn btn-primary btnTitle">广告默认封面</button>
				         </div>
						 <div class="flashImgHomePageImg">
						     <img id="pictureAdImg" src="" alt="" />
						 </div>
					 </div>
					 <div class="flashImgBox">
                         <div class="topTitle">
				             <button class="btn btn-primary btnTitle">广告轮播图</button>
				         </div>
                         <div class="flashImgWrapOutside">
						     <div class="goLeftIcon" onclick="flashImg.leftClick()"></div>
						     <div class="flashImgWrap">
						         <ul id="pictureUl" class="adCoverFilmsWrap">
							     </ul>
						     </div>
					         <div class="goRightIcon" onclick="flashImg.rightClick()"></div>
						 </div>		
					 </div>					 
                 </div>
             </div>
         </div>
		 <script type="text/javascript" src="/Lvscore_Advertiser_Maven/advertiserWeb/static/vendor/ckplayer/ckplayer.js"></script>
	 </body>
</html>